package com.watson.patterns.behavior.observer;

public class ObserverDemo {

    public static void main(String[] args) {
        Observer observer1 = new User("zhangsan");
        Observer observer2 = new User("lisi");
        Observer observer3 = new User("wangwu");

        WechatObserverable observerable = new WechatObserverable();
        observerable.registerObserver(observer1);
        observerable.registerObserver(observer2);
        observerable.registerObserver(observer3);

        observerable.deleteObserver(observer1);
        observerable.setMessage("new article");

    }
}
